package com.etc.controller;

import com.etc.entity.Building;
import com.etc.entity.CommentResult;
import com.etc.service.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BuildingController {
    @Autowired
    private BuildingService buildingService;

    @RequestMapping("building/insert")
    public CommentResult insert(@RequestBody Building building)
    {

        int result = buildingService.insert(building);
        if (result>0){
            return new CommentResult(200,"success");
        }
        return new CommentResult(444,"failed");
    }
}
